<?php

namespace Sisesporte\Repository;

use Doctrine\ORM\EntityRepository;

class TipoFaixaEtariaRepository extends EntityRepository {
    
    public function fetchPairs() {
        $entities = $this->findAll();
        $array = array();

        foreach ($entities as $entity) {
            $array[$entity->getSqTipoFaixaEtaria()] = $entity->getNoTipoFaixaEtaria()." (".$entity->getNuIdadeInicial()." - ".$entity->getNuIdadeFinal()." anos)";
        }

        asort($array);
        return $array;
    }
}
